/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  height: 100vh;
  background-color: #f5f7fa;
}

/* 聊天室 */
.chatRoom {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 聊天室头部 */
.chatRoom-header {
  padding: 16px 24px;
  background: #1890ff;
  color: white;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.chatRoom-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

/* 聊天内容区域 */
.chatRoom-content {
  flex: 1;
  padding: 20px;
  background: #f9f9f9;
  contain: content;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

/* 消息样式 */
.message {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  transition: opacity 0.3s ease;
}

.message.left {
  margin-right: 60px;
}

.message.right {
  margin-left: 60px;
  justify-content: flex-end;
}

.message.right .messageContent {
  margin-right: 0;
  margin-left: 12px;
}

.message.right .messageText {
  background: #1890ff;
  color: white;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1890ff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.messageContent {
  margin: 0 12px;
  max-width: 70%;
  display: flex;
  flex-direction: column;
}

.messageHeader {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}

.username {
  font-weight: 500;
  font-size: 14px;
  color: #666;
}

.time {
  margin-left: 8px;
  font-size: 12px;
  color: #999;
}

.messageText {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  line-height: 1.5;
  position: relative;
}

.message.pending {
  opacity: 0.7;
}

/* 底部输入区域 */
.chatRoom-footer {
  padding: 16px;
  background: white;
  border-top: 1px solid #eee;
  display: flex;
  gap: 12px;
}

.input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.3s;
}

.input:focus {
  border-color: #1890ff;
}

.sendButton {
  padding: 0 24px;
  background: #1890ff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.sendButton:hover {
  background: #40a9ff;
}

.sendButton:disabled {
  background: #bfbfbf;
  cursor: not-allowed;
}

/* 加载动画 */
.spinner {
  display: flex;
  gap: 4px;
}

.bounce1, .bounce2, .bounce3 {
  width: 6px;
  height: 6px;
  background-color: white;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.bounce1 { animation-delay: -0.32s; }
.bounce2 { animation-delay: -0.16s; }

/* 登录表单 */
.loginOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loginBox {
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.loginBox h3 {
  margin: 0 0 24px;
  color: #333;
}

.loginBox input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 16px;
  outline: none;
  font-size: 14px;
}

.loginBox input:focus {
  border-color: #1890ff;
}

.loginBox button {
  width: 100%;
  padding: 12px;
  background: #1890ff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}

.loginBox button:hover {
  background: #40a9ff;
}

.loginBox button:disabled {
  background: #bfbfbf;
  cursor: not-allowed;
}

/* 操作按钮组 */
.buttonGroup {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  border-top: 1px solid #eee;
}

.actionButton {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
}

.humanButton {
  color: #1890ff;
  border-color: #1890ff;
}

.humanButton:hover {
  background: #1890ff;
  color: white;
}

.rateButton {
  color: #52c41a;
  border-color: #52c41a;
}

.rateButton:hover {
  background: #52c41a;
  color: white;
}

/* 模态框样式 */
.modalOverlay, .rateModalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal, .rateModalContent {
  background: white;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.modalInput {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 16px 0;
  outline: none;
}

.modalButtons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.modalSubmit, .modalCancel {
  padding: 8px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.modalSubmit {
  background: #1890ff;
  color: white;
  border: none;
}

.modalSubmit:hover {
  background: #40a9ff;
}

.modalCancel {
  background: white;
  border: 1px solid #ddd;
}

.modalCancel:hover {
  border-color: #1890ff;
  color: #1890ff;
}

/* 评价模态框特定样式 */
.rateModalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  padding: 20px;
}

.rateModalContent {
  background: white;
  padding: 32px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease;
  overflow-y: auto;
}

.rateModalInner {
  display: flex;
  flex-direction: column;
  min-height: min-content;
}

.rateModalTitle {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  color: #333;
}

.rateButtonGroup {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
  padding: 0 20px;
}

.rateOption {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 16px;
  border-radius: 12px;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.rateOption:hover {
  background: #f0f0f0;
}

.rateOption.active {
  background: #e6f7ff;
  border-color: #1890ff;
  color: #1890ff;
}

.rateIcon {
  font-size: 32px;
  margin-bottom: 12px;
}

.rateText {
  font-size: 16px;
  font-weight: 500;
}

.rateInput {
  width: 100%;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  margin: 16px 0;
  height: 200px;
  resize: none;
  outline: none;
  font-size: 14px;
  line-height: 1.6;
  background: #f9f9f9;
  transition: all 0.3s;
}

.rateInput:focus {
  border-color: #1890ff;
  background: white;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.rateModalActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  position: sticky;
  bottom: 0;
  background: white;
}

.rateSubmitButton, .rateCancelButton {
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.rateSubmitButton {
  background: #1890ff;
  color: white;
  border: none;
}

.rateSubmitButton:hover {
  background: #40a9ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.2);
}

.rateCancelButton {
  background: white;
  border: 1px solid #ddd;
  color: #666;
}

.rateCancelButton:hover {
  border-color: #1890ff;
  color: #1890ff;
}

/* 编辑按钮 */
.editButton {
  background: transparent;
  border: none;
  color: #1890ff;
  cursor: pointer;
  padding: 6px 12px;
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 16px;
}

.message:hover .editButton {
  opacity: 1;
}

/* 编辑模态框 */
.editModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.editForm {
  background: white;
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease;
}

.editForm h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.formGroup {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.formGroup textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  transition: all 0.3s;
  outline: none;
  background: #f9f9f9;
  height: 120px;
  resize: none;
}

.formActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.formGroup label {
  display: block;
  margin-bottom: 12px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.formGroup input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.3s;
  outline: none;
  background: #f9f9f9;
  flex-shrink: 0;
}

.formGroup input:focus,
.formGroup textarea:focus {
  border-color: #1890ff;
  background: white;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.formGroup input:read-only {
  background: #f5f5f5;
  cursor: not-allowed;
}

.formActions button {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.formActions button:first-child {
  background: #1890ff;
  color: white;
  border: none;
}

.formActions button:first-child:hover {
  background: #40a9ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.2);
}

.formActions button:last-child {
  background: white;
  border: 1px solid #ddd;
  color: #666;
}

.formActions button:last-child:hover {
  border-color: #1890ff;
  color: #1890ff;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
